<?php
	require_once('inc_admin.php');
?>
        <!--PAGE CONTENT -->
        <div id="content">

            <div class="inner" style="min-height:1200px;">
                <div class="row">
                    <div class="col-xs-12">
	<?php
		
$id=$_GET["id"];
mysql_connect("localhost","root","");
mysql_select_db("neu-video");
mysql_query("set names utf8");
//如果该视频类型中还有视频 该类型不能删除
$sql0="select * from videos where typeid=$id";
$rs0=mysql_query($sql0);
$num=mysql_num_rows($rs0);
if($num==0)
{
$sql="delete  from videotype where id=$id";
$num=mysql_query($sql);
if($num>0)
{
echo "delete type success!";
header("location:typeList.php");
}
else{
	echo "delete user failed!";
}

}else{
	echo "该类型中还有视频，不能删除该类型";
}
  ?>        

                    </div>
                </div>
                <hr />
            </div>
        </div>
       <!--END PAGE CONTENT -->
<?php 
require_once('template/footer.php');
?>












